package com.example.nacosconsumer1.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

@RestController
public class HelloController {

    @Autowired
    public RestTemplate restTemplate;


    @GetMapping("/hello")
    public String hello(){
        String object = restTemplate.getForObject("http://provider1/hello", String.class);
        return "object";
    }

}
